Ciao, il modello E-R relativo alle entità User, Group e Module può essere modificato aggiungendo attributi alle entità ma non cancellando o modificando quelli esistenti. La chiave dell'utente, quindi, non può essere modificata.
Per evitare che due utenti si registrino con lo stesso username devi inserire un controllo applicativo sulla form di registrazione. Puoi aggiungere una Validation Rule di tipo "Collection" al campo username e poi selezionare nel Properties View "User" come Entity e "username" come Attribute. A questo punto scegliendo come Predicate l'opzione "Not in Collection" e abilitando l'opzione Ignore Case l'utente non potrà registrarsi con uno username già esistente.
"Hi everybody, I just started to do the WebRatio tutorial written on the wiki. In particular I did the ones related to the login and protected modules. The Web application works properly but I have a doubt on the E-R model. The key of the User entity is placed on the ID attribute and not on the username one. How can I avoid that two users register using the same credentials? Can I change the E-R model or should I insert a check somewhere?"
Hi, the User, Group and Module E-R model can be modified adding new attributes on entities, but it's not possible to change or remove the existing ones. So, the User key can not be changed.
To avoid that two user register using the same username you must add a control on the registration form. You can add a "Collection" Validation Rule on the username field and then choose "User" as Entity and "username" as Attribute in the Properties View. Finally, you should choose "Not in Collection" as Predicate and you can enable the Ignore Case option. In this way you are sure that a user can not register using an existing username.